package model;

/**
 * This Class is a Customer Complaint Model which Saves Complaints Details for Customer  .
 * @author Tal
 *
 */


public class ComplaintModel 
{
	
	private int cid;
	private int comid;
	private String details;	
	private String reply;
	private int status;
	

	/**
	 * This is Default Complaint constructor.
	 * @param cid is a 0.
	 * @param comid is a 0.
	 * @param details is " " .
	 * @param status is 0.
	 */
	public ComplaintModel()
	{
       
		this.cid=0;
		this.comid=0;
		this.details="";
		this.status=0;	
	
	}
	
	/**
	 * This is Complaint constructor(UID).
	 * @param cid is a uid.
	 * @param comid is a 0.
	 * @param details is " " .
	 * @param status is 0.
	 */
	public ComplaintModel(int uid, int comid)
	{
		this();
		this.cid=uid;
		this.comid=comid;
	}
	
	
	/**
	 * This is Complaint constructor.
	 * @param cid is a Customer ID.
	 * @param comid is a Customer Compliant ID.
	 * @param details is a Complaint Details .
	 * @param status is a Complaint status.
	 */
	
	public ComplaintModel(int cid, int comid, String details, int status)
	{
		this();
		this.cid=cid;
		this.comid=comid;
		this.details=details;
		this.status=status;
	
	}
	
	/**
	 * This is Complaint constructor.
	 * @param cid is a Customer ID.
	 * @param comid is a Customer Compliant ID.
	 * @param details is a Complaint Details .
	 * @param reply is a Complaint reply from customer Service.
	 * @param status is a Complaint status.
	 */
	
	public ComplaintModel(int cid, int comid, String details,String reply, int status)
	{
		this();
		this.cid=cid;
		this.comid=comid;
		this.details=details;
		this.reply=reply;
		this.status=status;
	
	}
	
	
	/**
	 * This method returns customer id of complaint.
	 * @return int type.
	 */
		public int getCID() {
			return this.cid;
		}

	/**
	 * This method sets new customer id to customer in complaint.
	 * @param cid - new cus's Id.
	 */
		public void setCID(int cusID) {
			this.cid = cusID;
		}


	/**
	 * This method returns complaint ID.
	 * @return int type.
	 */
		public int getComID() {
			return this.comid;
		}

	/**
	 * This method sets new complaint id to complaint.
	 * @param comid - new com's Id.
	 */
		public void setComID(int complaintID) {
			this.comid = complaintID;
		}

			
	/**
	 * This method returns complaint details.
	 * @return String type.
	 */
		public String getDetails() {
			return this.details;
		}

	/**
	 * This method sets new complaint details in complaint.
	 * @param details - new complaint Details.
	 */
		public void setDetails(String compDet) {
			this.details = compDet;
		}
		
		/**
		 * This method returns customer service reply.
		 * @return String type.
		 */
			public String getReply() {
				return this.reply;
			}

		/**
		 * This method sets new customer service reply.
		 * @param reply - new customer service reply.
		 */
			public void setReply(String reply) {
				this.reply = reply;
			}
				
	/**
	  * This method returns status of complaint.
	  * @return String type.
	 */
		public String getStatusString() {
			return  this.getType(status); 
		}
		
		/**
		  * This method returns status of complaint.
		  * @return int type.
		 */
		
		public int getStatusInt() {
			return this.status; 
		}

		
	/**
	  * This method sets new status to complaint.
	  * @param status - new complaint status .
	  */
    	public void setStatus(int comstatus) {
		this.status = comstatus;
	    }
    	
    	/**
    	 * This method get String status 
    	 * @param status
    	 * @return String
    	 */
    	
    	public String getType(int status)
    	{
    		if (status==0)
    			return "Unhandled";
    		if(status==1)
    			return "InProcess";
    		if (status==2)
    			return "Handled";
    		
			return "error";
    		
    	}

}
